<template>
  <view class="richtext" :style="'padding: ' + mydata.p_t + 'rpx ' + mydata.p_lr+ 'rpx ' + mydata.p_b  + 'rpx'">
    <view class="mcontainer" :style="contentstyle">
      <!-- <view class="notice-swiper" v-html="content"></view> -->
	  <u-parse  :tag-style="style" :domain="baseUrl" :html="content" :show-with-animation="true"></u-parse></view>
    </view>
  </view>
</template>

<script>
	import util from '@/common/util.js'
	import base from '@/common/baseUrl.js';
	import {mapState, mapMutations} from 'vuex';	
  export default {
    props: {
      mydata: {
        type: Object,
        default: {},
		
      }
    },
	data(){
		return{
		style: {
			// 字符串的形式
			p: 'word-wrap : break-word'
		}
		}
	},
    computed:{
      contentstyle(){
        let a='background:' + this.mydata.bg_color + ';border-radius:' + this.mydata.r_t+ 'rpx ' + this.mydata.r_t + 'rpx ' + this.mydata.r_b+ 'rpx ' + this.mydata.r_b+ 'rpx'+';padding:0 '+this.mydata.p_i+'rpx';
        return a
      },
	  baseUrl(){
		return util.geturl(base.baseUrl)
	  },
	  content(){
	    return this.mydata.content?util.decodeUnicode(this.mydata.content):''
	  },
	  ...mapState({
	  	details: state => state.details,
	  	oss: state => state.oss
	  })
    },
	created() {
	}
  }
</script>

<style scoped lang="scss">
  .richtext{
    box-sizing: border-box;
    .mcontainer{
          overflow: hidden;
          .notice-swiper{
                word-break: break-word;
                min-height: 30px;
          }
    }
  }
</style>
